<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>get2-koa</title>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
</head>
<body>
<div id="case8-demo1">
    <button v-on:click="sendRequest" name="btn">请求</button>
</div>
<script type="text/javascript">
    var case8Demo=new Vue({
        el:"#case8-demo1",
        data:{
            info:null
        },
        methods:{
            sendRequest:()=>{
                axios
                .get("http://localhost:3000/")
                .then(response=>(
                    this.info=response,
                    console.log(this.info),
                    console.log(this.info.data)))
                .catch(function (error) {//请求失败处理
                    console.log(error)
                })
            }
        }
    })
</script>
</body>
</html>